home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / s / movepage.pprx < prev    next >
Text File  |  1992-03-14  |  1KB  |  52 lines

  1. /*
  2. @BMovePages  @P@ICopyright Gold Disk Inc., January, 1992
  3.  
  4. This genie will move a range of pages within a document.
  5. */
  6. address command
  7. call SafeEndEdit.rexx()
  8. call ppm_AutoUpdate(0)
  9. cr = '0a'x
  10.  
  11. first = ppm_DocFirstPage()
  12. last = ppm_DocLastPage()
  13. cpage = ppm_CurrentPage()
  14. if cpage = 0 then exit_msg("Please create a page before running this Genie.")
  15.  
  16. form = "Start Page:"cpage||cr"End Page:"cpage||cr"Destination Page:"last
  17. form = ppm_GetForm("Enter_Range", 8, form)
  18. if form = '' then exit_msg()
  19.  
  20. parse var form startpage '0a'x endpage '0a'x dest
  21.  
  22. if ~(datatype(startpage, n) & datatype(endpage, n) & datatype(dest,n)) then
  23.     exit_msg("Invalid Entry")
  24.  
  25. if startpage > endpage then
  26. do
  27.     temp = endpage
  28.     endpage = startpage
  29.     startpage = temp
  30. end
  31.  
  32. if startpage < first | startpage > last | endpage < first | endpage > last | dest > last | dest < first  | (dest > startpage & dest < endpage ) then 
  33.     exit_msg('Invalid Input')
  34.  
  35. do i = startpage to endpage 
  36.     call ppm_MovePage(startpage, dest)
  37. end
  38.  
  39. call exit_msg("Done")
  40.  
  41. exit_msg: procedure 
  42. do
  43.     parse arg message
  44.  
  45.     if message ~= '' then call ppm_Inform(1, message,)
  46.     call ppm_AutoUpdate(1)
  47.     exit
  48.  
  49. end
  50.  
  51.  
  52.